<?php /* Smarty version Smarty-3.1.12, created on 2016-07-11 14:18:07
         compiled from "D:\phpStudy\WWW\demonew\dm\xycms\guestbook.tpl" */ ?>
<?php /*%%SmartyHeaderCode:2659357833a1f07dbf5-16131648%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    'aad9e71645e0d1ca6e5f761ead499d494b59e87f' => 
    array (
      0 => 'D:\\phpStudy\\WWW\\demonew\\dm\\xycms\\guestbook.tpl',
      1 => 1429337866,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '2659357833a1f07dbf5-16131648',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'page_charset' => 0,
    'copyright_author' => 0,
    'action' => 0,
    'book' => 0,
    'volist' => 0,
    'total' => 0,
    'pagecount' => 0,
    'showpage' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.12',
  'unifunc' => 'content_57833a1f11a590_16520569',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_57833a1f11a590_16520569')) {function content_57833a1f11a590_16520569($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include 'D:\\phpStudy\\WWW\\demonew\\source\\core\\plugins\\modifier.date_format.php';
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $_smarty_tpl->tpl_vars['page_charset']->value;?>
" />
<title>营销中心</title>
<meta name="author" content="<?php echo $_smarty_tpl->tpl_vars['copyright_author']->value;?>
" />
<link type="text/css" rel="stylesheet" href="xycms/css/admin.css" media="screen" />
<script type='text/javascript' src='js/jquery-1.8.3.min.js'></script>
<script type='text/javascript' src='js/command.js'></script>
<script type="text/javascript" src='../data/editor/kindeditor.js'></script>
</head>
<body>
<?php if ($_smarty_tpl->tpl_vars['action']->value==''){?>
<div class="main-wrap">
  <div class="path"><p>当前位置：营销中心<span>&gt;</span>询盘管理</p></div>
  <div class="main-cont">
    <h3 class="title">询盘管理</h3>
	<form action="xycms_guestbook.php" method="post" name="myform" id="myform" style="margin:0">
	<input type="hidden" name="action" id="action" value="del" />
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="table" align="center">
	  <thead class="tb-tit-bg">
	  <tr>
	    <th width="30"><div class="th-gap">选择</div></th>
		<th width="8%"><div class="th-gap">留言人</div></th>
		<th width="12%"><div class="th-gap">联系方式</div></th>
		<th width="31%"><div class="th-gap">内容</div></th>
		<th width="12%"><div class="th-gap">留言时间</div></th>
		<th width="12%"><div class="th-gap">IP</div></th>
		<th width="10%"><div class="th-gap">已读/未读</div></th>
		<th><div class="th-gap">操作</div></th>
	  </tr>
	  </thead>
	  <tfoot class="tb-foot-bg"></tfoot>
	  <?php  $_smarty_tpl->tpl_vars['volist'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['volist']->_loop = false;
 $_from = $_smarty_tpl->tpl_vars['book']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['volist']->key => $_smarty_tpl->tpl_vars['volist']->value){
$_smarty_tpl->tpl_vars['volist']->_loop = true;
?>
	  <tr onmouseover="overColor(this)" onmouseout="outColor(this)">
	    <td align="center"><input name="id[]" type="checkbox" value="<?php echo $_smarty_tpl->tpl_vars['volist']->value['id'];?>
" onclick="checkItem(this, 'chkAll')" /></td>
		<td align="center"><?php echo $_smarty_tpl->tpl_vars['volist']->value['name'];?>
</td>
        <td align="center"><?php echo $_smarty_tpl->tpl_vars['volist']->value['contact'];?>
</td>
		<td align="left"><?php echo $_smarty_tpl->tpl_vars['volist']->value['content'];?>
</td>
		<td align="center" style="color:#999;font-size:12px;"><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['volist']->value['timeline'],"%Y/%m/%d %H:%M:%S");?>
</td>
		<td align="center"><?php echo $_smarty_tpl->tpl_vars['volist']->value['ip'];?>
</td>
		<td align="center"><?php if ($_smarty_tpl->tpl_vars['volist']->value['isread']==1){?><a href="javascript:void(0)" onclick="messageRead(<?php echo $_smarty_tpl->tpl_vars['volist']->value['id'];?>
);" class="read already" id="r<?php echo $_smarty_tpl->tpl_vars['volist']->value['id'];?>
">设为未读</a><?php }else{ ?><a href="javascript:void(0)" onclick="messageRead(<?php echo $_smarty_tpl->tpl_vars['volist']->value['id'];?>
);" class="read" id="r<?php echo $_smarty_tpl->tpl_vars['volist']->value['id'];?>
">设为已读</a><?php }?></td>
		<td align="center"><a href="xycms_guestbook.php?action=del&id[]=<?php echo $_smarty_tpl->tpl_vars['volist']->value['id'];?>
" onclick="{if(confirm('确定要删除该信息?')){return true;} return false;}" class="icon-del">删除</a></td>
	  </tr>
	  <?php }
if (!$_smarty_tpl->tpl_vars['volist']->_loop) {
?>
      <tr>
	    <td colspan="8" align="center">暂无信息</td>
	  </tr>
	  <?php } ?>
	  <?php if ($_smarty_tpl->tpl_vars['total']->value>0){?>
	  <tr>
		<td align="center"><input name="chkAll" type="checkbox" id="chkAll" onclick="checkAll(this, 'id[]')" value="checkbox" /></td>
		<td class="hback" colspan="7"><input class="button" name="btn_del" type="button" value="删 除" onclick="{if(confirm('确定删除选定信息吗!?')){$('#action').val('del');$('#myform').submit();return true;}return false;}" class="button" />&nbsp;&nbsp;共[ <b><?php echo $_smarty_tpl->tpl_vars['total']->value;?>
</b> ]条记录</td>
	  </tr>
	  <?php }?>
	</table>
	</form>
	<?php if ($_smarty_tpl->tpl_vars['pagecount']->value>1){?>
	<table width='95%' border='0' cellspacing='0' cellpadding='0' align='center' style="margin-top:10px;">
	  <tr>
		<td align='center'><?php echo $_smarty_tpl->tpl_vars['showpage']->value;?>
</td>
	  </tr>
	</table>
	<?php }?>
  </div>
</div>
<?php }?>

<script type="text/javascript">
	function messageRead(id){
	  var dom = $("#r"+id);
	  var num = 2;
	  if(dom.hasClass("already")){
		  num = 1;
	  }
	  $.ajax({
		  type: "GET",
		  url: "xycms_guestbook.php",
		  dataType: "text",
		  data: {"action":'isread',"read":num,"id":id},
		  success: function(data) {		  
			if(data == 2 || data == 3){
				alert("id参数错误，操作失败！");
			}else if(data == 1){
				if(num == 1){
					str = '设为已读';
					dom.removeClass("already");
				}else if(num == 2){
					str = '设为未读';
					dom.addClass("already");
				}
				dom.text(str);
			}
			
		  }
		  
	  });		
		
	}
</script>
</body>
</html>

<?php }} ?>